<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Swiper 轮播图</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .swiper{
            width: 500px;
            height: 200px;
            border: 1px solid #000;
            overflow: hidden;
            margin: 100px;
            position: relative;
        }
        .swiper ul{
            width: 1500px;
            margin-left: 0px;
            overflow: hidden;
            position: absolute;
        }
        .swiper ul li{
            float: left;
            width: 500px;
            height: 200px;
            list-style: none;
            text-align: center;
            line-height: 200px;
            color: #fff;
            font-size: 30px;
        }
    </style>
</head>
<body>
    <div class="swiper">
        <ul>
            <li style="background: #C81522;">1</li>
            <li style="background: #FFAA00;">2</li>
            <li style="background: #2577E3;">3</li>
        </ul>
    </div>

    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script>
        var num = 0;
        var timer = setInterval(function(){
                        $(".swiper ul").animate({left: -num+'px'});
                        num+=500
                        console.log(num)
                        if(num == 1500){
                            num = 0
                            setTimeout(function(){
                                $(".swiper ul").animate({left: -num+'px'});
                            },1000)
                        }
                    },3000)

    </script>
</body>
</html>